Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data-tables] - Upgrade to core-tracing preview 14 #20399

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

maorleger
Copy link
Member

@maorleger maorleger commented Feb 15, 2022

Packages impacted by this PR

@azure/data-tables

Issues associated with this PR

Describe the problem that is addressed by this PR

Now that @azure/[email protected] is out, and hopefully the last version
before GA, we need to upgrade a few packages in order to dogfood both the
upgrade experience and the usage of these packages with the new instrumentation package.

My goal was to upgrade one AMQP package and a few HTTP packages in addition to
core-rest-pipeline to collect feedback.

Upgrading Data Tables now allows us to start using the new APIs in a client package.

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

Yup!

Provide a list of related PRs (if any)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)

sdk/tables/data-tables/CHANGELOG.md Show resolved Hide resolved
sdk/tables/data-tables/src/TableClient.ts Show resolved Hide resolved

try {
let result = await this._listEntities<T>(tableName, updatedOptions);
let result = await tracingClient.withSpan(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to thoroughly test how this looks now to make sure all looks ok as far as parenting, etc.

Also added the continuation token as an attribute on a span

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what it ends up looking like - which I think is what we landed on. With this in place I am thinking we can close #5607 - I have a separate issue tracking adding these as guidelines

@@ -619,4 +619,35 @@ describe(`TableClient`, () => {
});
});
});

describe("tracing", () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I had one test per client method, which may be better / clearer. Alternatively, this is kinda neat in that you're just telling a story of a client invoking various operations and then ensuring tracing spans tell the same story. Not sure which is nicer - feel free to sound off in the comments (and don't forget to like, comment, and subscribe 😆 )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked, commented and subscribed to the idea :D

@check-enforcer
Copy link

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run js - [service] - ci

@maorleger
Copy link
Member Author

/check-enforcer evaluate

@maorleger
Copy link
Member Author

Build is passing, not sure why check-enforcer is drunk https://dev.azure.com/azure-sdk/public/_build/results?buildId=1369906&view=results

Copy link
Member

@joheredi joheredi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I love how simple it becomes in general!

Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the approach is good

@maorleger maorleger merged commit 3029e42 into Azure:main Feb 17, 2022
@maorleger maorleger deleted the upgrade-data-tables branch February 17, 2022 23:27
logger.info("TableClient-deleteTable: Table doesn't exist");
} else {
span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });
throw e;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😓 we missed re-throwing if the status code is not 404. I'll send out a PR to fix this soon

azure-sdk pushed a commit to azure-sdk/azure-sdk-for-js that referenced this pull request Oct 14, 2022
[2022-04-01-preview] Add New Api-version for Microsoft.ApiManagement (Azure#20399)

* Adds base for updating Microsoft.ApiManagement from version preview/2021-12-01-preview to version 2022-04-01-preview

* Updates readme

* Updates API version in new specs and examples

* APIM Auth Servers (Azure#19234)

* APIM Auth Servers

* adding x-ms-identifiers

* removing some weird, invisible special char

* formatting

* oAuth2AuthenticationSettings moved to AuthSettings

* Formatting

Co-authored-by: Milan Zolota <[email protected]>

* API Management Authorization Endpoints (Azure#19615)

* Add blockchain to latest profile

* Add additional types

* add authorizations definitions

* authorizations operations

* add examples

* update readme

* fix examples

* fix linter delete errors

* address CI validation errors

* prettier fix

* update to 2022-04

* fix readme

* Update specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2022-04-01-preview/apimauthorizationproviders.json

Co-authored-by: Sean Kim <[email protected]>

* update versions

* Apply suggestions from code review

Co-authored-by: Mark Cowlishaw <[email protected]>
Co-authored-by: Annaji Sharma Ganti <[email protected]>
Co-authored-by: Annaji Sharma Ganti <[email protected]>

* Move Long running Create Operation from Location based to Azure-AsyncOperation Header (Azure#19733)

* azure-asyncOperation

* prettier

* fix(apim): Add missing 'metrics' property to diagnostics contract in 2022-04-01-preview (Azure#20317)

* apim /PUT apis import add translateRequiredQueryParameters (Azure#20333)

* [2022-04-01-preview] Replace resource with proxyresource and TrackedResource (Azure#20461)

* replace resource with proxyresource

* revert to proxyresource

* Add type object to authorization definitions (Azure#20631)

Authorization definitions were missing "type": "object", and this change adds that key/value pair

* Add type object to policy fragment definition (Azure#20585)

* APIM Open ID Connect providers (Azure#20622)

* APIM Open ID Connect providers

* added new proeprties for update

* prettier

* [APIM] Add Nat Gateway (Azure#19990)

* Update apimdeployment.json

* Create ApiManagementCreateServiceWithNatGatewayEnabled.json

* fix typo in file

* Change Nat Gateway property to enum

* modify type of natgateway state

* update property name

* add example reference

* small fix in example

* rename to  outboundPublicIPAddresses

Co-authored-by: Samir Solanki <[email protected]>

* [2022-04-01-preview] MIgrate2Stv2 API (Azure#20504)

* migrate2stv2

* updated to post

* 202 and location

* add body to 202

* remove body from 202

Co-authored-by: Vatsa Patel <[email protected]>
Co-authored-by: Samir Solanki <[email protected]>
Co-authored-by: [email protected] <[email protected]>

* Address Authorizations MissingTypeObject errors (Azure#20919)

* Add forgotten If-Match header (Azure#20920)

* Add forgotten If-Match header

`If-Match` header for the `DeleteAuthorizationAccessPolicy.json file` was forgotten. This change adds the wildcard character for the `If-Match` header for that file.

* Update ApiManagementDeleteAuthorization.json

* Use common types for specs and count as readonly (Azure#21023)

* common types

* count readonly

* Sasolank/more review comments (Azure#21025)

* XML

* proxy to gateway

* Update Authorizations Spec (Azure#21027)

* Update definitions.json

Update wording for PostGetLoginLink endpoint description

* Update apimauthorizationproviders.json

Add 201 response to all Authorization PUT requests

* Updated examples and fixed formatting

There was a formatting issue within apimauthorizationproviders.json, and the Authorization examples needed to be updated with the new 201 responses for creating/updating Authorization entities.

* Add long-running-operation key/value

Added x-ms-long-running-operation: true to Authorization PUT requests

* Remove long-running-operations

* readonly revert (Azure#21050)

* Set  SchemaContract.Document as required. (Azure#20110)

* Updated documentation of the SchemaContract. Server use to return code 500 in case SchemaContract.Document is null. That issue was fixed in the APIM and server will return proper response code.

* Fix AzureApiValidation

* update field with properties

* revert remaining readonly on collection (Azure#21051)

* Change to camel casing for "accesspolicies" (Azure#21070)

* Change to camel casing for "accesspolicies"

* More camel casing updates for access policies

* list example fixed (Azure#21089)

* fix definition (Azure#21110)

* upgrade to v3 for common types (Azure#21109)

* upgrade to v3

* Space

* revert to v2 proxyResource

Co-authored-by: Milan Zolota <[email protected]>
Co-authored-by: Milan Zolota <[email protected]>
Co-authored-by: Sean D Kim <[email protected]>
Co-authored-by: Mark Cowlishaw <[email protected]>
Co-authored-by: Annaji Sharma Ganti <[email protected]>
Co-authored-by: Annaji Sharma Ganti <[email protected]>
Co-authored-by: Tom Kerkhove <[email protected]>
Co-authored-by: Korolev Dmitry <[email protected]>
Co-authored-by: Logan Zipkes <[email protected]>
Co-authored-by: Rafał Mielowski <[email protected]>
Co-authored-by: malincrist <[email protected]>
Co-authored-by: GuanchenIntern <[email protected]>
Co-authored-by: VatsaPatel <[email protected]>
Co-authored-by: Vatsa Patel <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Maxim Agapov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants